package com.codeczx.materialdialogdemo;

import android.os.Handler;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.ProgressBar;
import android.widget.RelativeLayout;

import com.afollestad.materialdialogs.MaterialDialog;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        MaterialDialog md = new MaterialDialog.Builder(this)
                .customView(R.layout.dialog_notify,false)
                .build();
        final RelativeLayout rl= (RelativeLayout) md.getCustomView().findViewById(R.id.rl);
        final ProgressBar pg = (ProgressBar) md.getCustomView().findViewById(R.id.pg);
        md.show();
        Handler handler = new Handler();
        handler.postDelayed(new Runnable() {
            @Override
            public void run() {
                pg.setVisibility(View.GONE);
                rl.setVisibility(View.VISIBLE);
            }
        },5000);
    }
}
